using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;

using ILRuntime.CLR.TypeSystem;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
using ILRuntime.Runtime.Stack;
using ILRuntime.Reflection;
using ILRuntime.CLR.Utils;
using System.Linq;

namespace ILRuntime.Runtime.Generated
{
    unsafe class huqiang_UIComposite_PopMenu_Binding
    {
        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
        {
            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
            MethodBase method;
            FieldInfo field;
            Type[] args;
            Type type = typeof(huqiang.UIComposite.PopMenu);
            args = new Type[]{typeof(huqiang.Data.FakeStruct), typeof(huqiang.Core.HGUI.UIElement), typeof(huqiang.Core.HGUI.UIInitializer)};
            method = type.GetMethod("Initial", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Initial_0);
            args = new Type[]{};
            method = type.GetMethod("get_Root", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, get_Root_1);
            args = new Type[]{typeof(huqiang.UIEvent.UserEvent), typeof(huqiang.UIEvent.UserAction)};
            method = type.GetMethod("DefItemClick", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, DefItemClick_2);
            args = new Type[]{typeof(huqiang.UIEvent.UserEvent), typeof(huqiang.UIEvent.UserAction)};
            method = type.GetMethod("PointerEntry", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, PointerEntry_3);
            args = new Type[]{};
            method = type.GetMethod("Refresh", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Refresh_4);
            args = new Type[]{typeof(UnityEngine.Vector3)};
            method = type.GetMethod("SetPosition", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, SetPosition_5);
            args = new Type[]{};
            method = type.GetMethod("Clear", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Clear_6);

            field = type.GetField("ItemClick", flag);
            app.RegisterCLRFieldGetter(field, get_ItemClick_0);
            app.RegisterCLRFieldSetter(field, set_ItemClick_0);
            app.RegisterCLRFieldBinding(field, CopyToStack_ItemClick_0, AssignFromStack_ItemClick_0);
            field = type.GetField("ContentW", flag);
            app.RegisterCLRFieldGetter(field, get_ContentW_1);
            app.RegisterCLRFieldSetter(field, set_ContentW_1);
            app.RegisterCLRFieldBinding(field, CopyToStack_ContentW_1, AssignFromStack_ContentW_1);
            field = type.GetField("ItemH", flag);
            app.RegisterCLRFieldGetter(field, get_ItemH_2);
            app.RegisterCLRFieldSetter(field, set_ItemH_2);
            app.RegisterCLRFieldBinding(field, CopyToStack_ItemH_2, AssignFromStack_ItemH_2);
            field = type.GetField("Language", flag);
            app.RegisterCLRFieldGetter(field, get_Language_3);
            app.RegisterCLRFieldSetter(field, set_Language_3);
            app.RegisterCLRFieldBinding(field, CopyToStack_Language_3, AssignFromStack_Language_3);


            app.RegisterCLRCreateDefaultInstance(type, () => new huqiang.UIComposite.PopMenu());
            app.RegisterCLRCreateArrayInstance(type, s => new huqiang.UIComposite.PopMenu[s]);

            args = new Type[]{};
            method = type.GetConstructor(flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Ctor_0);

        }


        static StackObject* Initial_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 4);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.Core.HGUI.UIInitializer @initializer = (huqiang.Core.HGUI.UIInitializer)typeof(huqiang.Core.HGUI.UIInitializer).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.Core.HGUI.UIElement @script = (huqiang.Core.HGUI.UIElement)typeof(huqiang.Core.HGUI.UIElement).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            huqiang.Data.FakeStruct @mod = (huqiang.Data.FakeStruct)typeof(huqiang.Data.FakeStruct).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 4);
            huqiang.UIComposite.PopMenu instance_of_this_method = (huqiang.UIComposite.PopMenu)typeof(huqiang.UIComposite.PopMenu).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.Initial(@mod, @script, @initializer);

            return __ret;
        }

        static StackObject* get_Root_1(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.UIComposite.PopMenu instance_of_this_method = (huqiang.UIComposite.PopMenu)typeof(huqiang.UIComposite.PopMenu).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.Root;

            object obj_result_of_this_method = result_of_this_method;
            if(obj_result_of_this_method is CrossBindingAdaptorType)
            {    
                return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
            }
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static StackObject* DefItemClick_2(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 3);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.UIEvent.UserAction @action = (huqiang.UIEvent.UserAction)typeof(huqiang.UIEvent.UserAction).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.UIEvent.UserEvent @user = (huqiang.UIEvent.UserEvent)typeof(huqiang.UIEvent.UserEvent).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            huqiang.UIComposite.PopMenu instance_of_this_method = (huqiang.UIComposite.PopMenu)typeof(huqiang.UIComposite.PopMenu).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.DefItemClick(@user, @action);

            return __ret;
        }

        static StackObject* PointerEntry_3(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 3);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.UIEvent.UserAction @action = (huqiang.UIEvent.UserAction)typeof(huqiang.UIEvent.UserAction).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.UIEvent.UserEvent @user = (huqiang.UIEvent.UserEvent)typeof(huqiang.UIEvent.UserEvent).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            huqiang.UIComposite.PopMenu instance_of_this_method = (huqiang.UIComposite.PopMenu)typeof(huqiang.UIComposite.PopMenu).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.PointerEntry(@user, @action);

            return __ret;
        }

        static StackObject* Refresh_4(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.UIComposite.PopMenu instance_of_this_method = (huqiang.UIComposite.PopMenu)typeof(huqiang.UIComposite.PopMenu).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.Refresh();

            return __ret;
        }

        static StackObject* SetPosition_5(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.Vector3 @pos = (UnityEngine.Vector3)typeof(UnityEngine.Vector3).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)16);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.UIComposite.PopMenu instance_of_this_method = (huqiang.UIComposite.PopMenu)typeof(huqiang.UIComposite.PopMenu).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.SetPosition(@pos);

            return __ret;
        }

        static StackObject* Clear_6(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.UIComposite.PopMenu instance_of_this_method = (huqiang.UIComposite.PopMenu)typeof(huqiang.UIComposite.PopMenu).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.Clear();

            return __ret;
        }


        static object get_ItemClick_0(ref object o)
        {
            return ((huqiang.UIComposite.PopMenu)o).ItemClick;
        }

        static StackObject* CopyToStack_ItemClick_0(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.PopMenu)o).ItemClick;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_ItemClick_0(ref object o, object v)
        {
            ((huqiang.UIComposite.PopMenu)o).ItemClick = (System.Action<huqiang.UIComposite.MenuItem>)v;
        }

        static StackObject* AssignFromStack_ItemClick_0(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Action<huqiang.UIComposite.MenuItem> @ItemClick = (System.Action<huqiang.UIComposite.MenuItem>)typeof(System.Action<huqiang.UIComposite.MenuItem>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)8);
            ((huqiang.UIComposite.PopMenu)o).ItemClick = @ItemClick;
            return ptr_of_this_method;
        }

        static object get_ContentW_1(ref object o)
        {
            return ((huqiang.UIComposite.PopMenu)o).ContentW;
        }

        static StackObject* CopyToStack_ContentW_1(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.PopMenu)o).ContentW;
            __ret->ObjectType = ObjectTypes.Float;
            *(float*)&__ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_ContentW_1(ref object o, object v)
        {
            ((huqiang.UIComposite.PopMenu)o).ContentW = (System.Single)v;
        }

        static StackObject* AssignFromStack_ContentW_1(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Single @ContentW = *(float*)&ptr_of_this_method->Value;
            ((huqiang.UIComposite.PopMenu)o).ContentW = @ContentW;
            return ptr_of_this_method;
        }

        static object get_ItemH_2(ref object o)
        {
            return ((huqiang.UIComposite.PopMenu)o).ItemH;
        }

        static StackObject* CopyToStack_ItemH_2(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.PopMenu)o).ItemH;
            __ret->ObjectType = ObjectTypes.Float;
            *(float*)&__ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_ItemH_2(ref object o, object v)
        {
            ((huqiang.UIComposite.PopMenu)o).ItemH = (System.Single)v;
        }

        static StackObject* AssignFromStack_ItemH_2(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Single @ItemH = *(float*)&ptr_of_this_method->Value;
            ((huqiang.UIComposite.PopMenu)o).ItemH = @ItemH;
            return ptr_of_this_method;
        }

        static object get_Language_3(ref object o)
        {
            return ((huqiang.UIComposite.PopMenu)o).Language;
        }

        static StackObject* CopyToStack_Language_3(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.PopMenu)o).Language;
            object obj_result_of_this_method = result_of_this_method;
            if(obj_result_of_this_method is CrossBindingAdaptorType)
            {    
                return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
            }
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_Language_3(ref object o, object v)
        {
            ((huqiang.UIComposite.PopMenu)o).Language = (huqiang.Data.INISection)v;
        }

        static StackObject* AssignFromStack_Language_3(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            huqiang.Data.INISection @Language = (huqiang.Data.INISection)typeof(huqiang.Data.INISection).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.UIComposite.PopMenu)o).Language = @Language;
            return ptr_of_this_method;
        }



        static StackObject* Ctor_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* __ret = ILIntepreter.Minus(__esp, 0);

            var result_of_this_method = new huqiang.UIComposite.PopMenu();

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }


    }
}
